#ifdef _WIN32
#ifndef STRAY_LOST_RESOURCE_MANAGER_H
#define STRAY_LOST_RESOURCE_MANAGER_H

#include "../../../Common.h"
#include "../../../Object/Singleton.h"
#include "../../../Container/Set.h"
#include "LostResource.h"

namespace Stray {
namespace Core {
namespace Graphics {
namespace DirectX9 {

class LostResourceManagerImpl
{
	friend class Stray::SingletonHolder<LostResourceManagerImpl>;
public:
	void initialize();
	void terminate();

	void addResource(LostResource* pResource);
	void removeResource(LostResource* pResource);
	void releaseResource();
	void recoverResource();
private:
	typedef Stray::HashSet<LostResource*>::type LostResourceSet;
	LostResourceSet resources_;
private:
	Stray::Bool hasInitialized_;
	Stray::Bool hasTerminated_;
	LostResourceManagerImpl():hasInitialized_(Stray::B_FALSE){}
	LostResourceManagerImpl(const LostResourceManagerImpl&);
	~LostResourceManagerImpl(){}
	const LostResourceManagerImpl& operator =(const LostResourceManagerImpl&);
};

typedef Stray::SingletonHolder<LostResourceManagerImpl> LostResourceManager;

}
}
}
}

#endif
#endif